﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>收货地址 - ${web.name}${web.additionalTitle!}</title>
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
	$("#jvForm").validate();
});
function fetchGift(id){
	var giftNumb=$("#giftNumb").val();
	if(giftNumb==""||giftNumb<1){
         alert("请输入数量/正整数!");
         return false;
		}
	if(giftNumb.indexOf('.')!=-1){
         alert('请输入整数!');
         return false;
		}alert("tt");
    $.post("fetchGift.jspx",{giftId:id,giftNumb:giftNumb},function(data){
                  alert(data);
        });
}

function check(numb,store){
	alert(numb+" "+store);
 if(numb>store){
         alert("库存不足!");
         $("#giftNumb").val("");
         return false;
	 }
	return true;
}
</script>
</head>
<body>
[#include '../shop/inc_head.html'/]
<h1>礼品选择</h1>
<p>[#include 'inc_member_function.html'/]</p>
<h3 style="color:red">礼品选择</h3> <h2><a href="shopping_cart.jspx">查看购物车</a></h2>
<form action="my_address.jspx" id="jvForm" method="post">
<table border="1" width="800">
</table>
</form>
[#if pagination??&&pagination?size gt 0]
   <table><tr><td>礼品名称</td><td>所需积分</td><td>礼品库存</td><td>礼品图片</td><td>瑞换件数</td><td>是否瑞换</td></tr>
     [#list pagination.list as gifts]
        <tr><tr><td>${gifts.giftName!}</td><td>${gifts.giftScore!}</td><td>${gifts.giftStock}</td><td>${gifts.giftPicture!}</td><td><input type="text" name="giftNumber" id="giftNumb" onblur="check(this.value,${gifts.giftStock!})"></td>
        <td><a href="javascript:void(0);"onclick="fetchGift(${gifts.id!});">是</a></td></tr>
     [/#list]
 </table>
[/#if]
[#include "../include/页脚信息栏.html"/]
<div>[@process_time/]</div>
</body>
</html>